<include file="common/hearder"/>
<br>
<div class="row">
    <div class="col-lg-12">
        <a href="{:U('index')}" class="btn btn-info">返回上一页</a>
        <a class="btn btn-primary glyphicon glyphicon-eye-open" onclick="$('#xs').submit();">批量显示</a>
        <div style="float: right;" class="col-lg-4">
            <form action="" method="post">
                <div class="input-group">
                    <input type="text" name="name" class="form-control" placeholder="{$name ? $name : '请输入菜单名称查找'}">
                    <span class="input-group-btn">
                    <button class="btn btn-default" type="submit">搜索</button>
                    </span>
                </div>
            </form>
       </div>
    </div>
</div>
<br>
<form id="xs" class="am-form" action="{:U('xs_all')}">
    <table class="table table-bordered">
        <tr>
            <td><input type="checkbox" class="check_all"></td>
            <td>菜单编号</td>
            <td>菜单名称</td>
            <td>控制器名称</td>
            <td>视图名称</td>
            <td>操作</td>
        </tr>
        <foreach name="menu_l" item="ml">
            <tr>
                <td><input type="checkbox" class="check_a" name="mids[]" value="{$ml.mid}"></td>
                <td>{$ml.mid}</td>
                <td>{$ml.name}</td>
                <td>{$ml.controll}</td>
                <td>{$ml.view}</td>
                <td>
                    <a href="{:U('xs',array('mid'=>$ml['mid'],'hidden'=>$ml['hidden']))}" class="btn btn-link glyphicon glyphicon-eye-open" style="text-decoration: none;">显示</a>
                    <a href="javascript:drop_confirm('确定要删除此菜单吗？','__URL__/delete/mid/{$ml.mid}/hidden/{$ml.hidden}')" class="btn btn-link glyphicon glyphicon-trash">删除</a>
                </td>
            </tr>
        </foreach>
    </table>
    <div class="ys">
        共{$count}条数据
        {$show}
    </div>
</form>
<script>
    <!--  全选和反选prop(); prop()方法设置或返回被选元素的属性和值-->
   $('.check_all').on('click',function () {
       if($(this).prop('checked')){
           $('.check_a').each(function () {
               if($(this).prop('checked')){
                   $(this).prop('checked',false);
               }else{
                   $(this).prop('checked',true);
               }
           });
       }else{
           $('.check_a').prop('checked',false);
       }
   });
</script>


<script>
function drop_confirm(message,pathurl)
{
if(confirm(message))
{
window.location.href=pathurl;
}else
{
return false;
}
}
</script> 
<include file="common/footer"/>